package com.qf.service.impl;

import com.qf.entity.Emp;
import com.qf.mapper.EmpMapper;
import com.qf.service.EmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * --- 年少有为 ---
 *
 * @author ChenZhuo
 * @date 2025/8/8
 * @desc
 */
@Service
public class EmpServiceImpl implements EmpService {

    @Autowired
    private EmpMapper empMapper;
    @Override
    public Boolean add(Emp emp) {
        Boolean add = empMapper.add(emp);
        return add;
    }

    @Override
    public Boolean deleteById(int empno) {
        Boolean result = empMapper.deleteById(empno);
        return  result;
    }



    @Override
    public List<Emp> list(int empno) {
        List<Emp> emps = empMapper.list(empno);
        return emps;
    }

    @Override
    public List<Emp> list() {
        List<Emp> emps = empMapper.listNoArgs();
        return emps;
    }

    @Override
    public Emp listById(int empno) {
       Emp emp = empMapper.listById(empno);
        return emp;
    }

    @Override
    public Boolean update(Emp emp) {
        Boolean update = empMapper.update(emp);
        return update;
    }
}
